export default {
  /**
   * 成功提示
   * @param {number} code
   * @param {string} message
   * @param {object} data
   * @returns
   */
  success: (code: number, message: string, data?: any) => {
    return { code: code || 200, message, data, success: true };
  },

  /**
   * 错误提示
   * @param {number} code
   * @param {string} message
   * @returns
   */
  fail: (code: number, message: string) => {
    return {
      code: code || 500,
      message: message || '服务器异常',
      success: false,
    };
  },
};
